import cv2
import subprocess as sp
import multiprocessing
import platform
import psutil
url = "rtsp://admin:abc123456789@192.168.1.65/Streaming/Channels/2"
print("正在拉流")
cap = cv2.VideoCapture(url)
print("正在输出")
ret, frame = cap.read()
while ret:
	# 读取视频帧
    ret, frame = cap.read()
	# 显示视频帧
    cv2.imshow("frame", frame)
	#等候1ms,播放下一帧，或者按q键退出
    if cv2.waitKey(1) & 0xFF == ord('q'):
        break

#释放视频流
cap.release()
#关闭所有窗口
cv2.destroyAllWindows()